//
//  HRZGlobalNetManager.h
//  EMarket
//
//  Created by 物联速通信息技术有限公司 on 2018/5/23.
//  Copyright © 2018 好日子. All rights reserved.
//

#import <Foundation/Foundation.h>



@class HRZSearchThemeGoodsModel;
@class HRZGoodsClassifyListSearchModel;

typedef void (^OperationResult)(BOOL isSuc);

@interface HRZGlobalNetManager : NSObject

+ (instancetype)getGlobalNetManager;


@end

#pragma mark - ----------  Home  ----------

@class HRZHomeItemBaseModel;

typedef void (^HomeInfoData)(HRZHomeItemBaseModel *result, BOOL isSuc);
typedef void (^HomeThemeGoodsData)(NSArray *result, BOOL isSuc, BOOL isMore);

/** 首页 */
@interface HRZGlobalNetManager (Home)

/** 主页广告 */
- (void)homePageInfoComplete:(HomeInfoData)complete;

/** 根据主题搜索商品 */
- (void)homeSearchThemeGoodsByThemeModel:(HRZSearchThemeGoodsModel *)model complete:(HomeThemeGoodsData)complete;
- (void)homeSearchThemeGoodsMoreComplete:(HomeThemeGoodsData)complete;

@end

#pragma mark - ----------  Goods  ----------
@class HRZGoodsClassifyBaseModel;
@class HRZGoodsClassifyContentModel;
@class HRZGoodsClassifyDetailModel;
@class HRZGoodsDetailModel;

typedef void (^GoodsFirstClassifyResult)(NSArray <HRZGoodsClassifyBaseModel *>* result, BOOL isSuc);
typedef void (^GoodsSecondClassifyResult)(HRZGoodsClassifyContentModel *result, BOOL isSuc);
typedef void (^GoodsClassifyListResult)(NSArray <HRZGoodsClassifyDetailModel *>*result, BOOL isSuc, BOOL isMore);
typedef void (^GoodsDetailResul)(HRZGoodsDetailModel *result, BOOL isSuc);

/**
 商品
 */
@interface HRZGlobalNetManager (Goods)

/** 搜索商品分类 一级分类*/
- (void)onSearchGoodsClassifyComplete:(GoodsFirstClassifyResult)complete;

/** 获取商品二级分类 */
- (void)onSearchGoodsClassifyContentByClassifyId:(NSString *)classifyId complete:(GoodsSecondClassifyResult)complete;

/** 获取商品列表 */
- (void)onSearchGoodsListBySerachModel:(HRZGoodsClassifyListSearchModel *)model complete:(GoodsClassifyListResult)complete;

/** 获取更多商品列表 */
- (void)onSearchMoreGoodsListComplete:(GoodsClassifyListResult)complete;

/** 获取商品详情 */
- (void)onSearchGoodsDetailByGoodsId:(NSString *)goodsId complete:(GoodsDetailResul)complete;

@end


#pragma mark - ----------  Cart  ----------

@class HRZAddShopCartModel;
@class HRZUpdateNumberModel;
@class HRZDeleteCarModel;
@class HRZGetShopCarListModel;

typedef void (^CartGetList)(NSArray *array, BOOL isSuc);

/** 购物车 */
@interface HRZGlobalNetManager (Cart)

/** 添加商品到购物车*/
- (void)addCartGoodsWithGoodsId:(NSString *)goodsId complete:(OperationResult)complete;
/** 更新购物车商品数量 */
- (void)updateCartGoodsNumberByCartModel:(HRZUpdateNumberModel *)model complete:(OperationResult)complete;
/** 删除购物车商品 */
- (void)deletedCartGoodsId:(NSString *)goodsId complete:(OperationResult)complete;
/** 获取购物车列表 */
- (void)onSearchCartGoodsListByCurrentShopComplete:(CartGetList)complete;

@end

#pragma mark - ----------  User  ----------

@class HRZUserInfo;
@class HRZAttestationModel;
@class HRZAddressUpdateModel;


typedef void (^UserRegisterData)(HRZUserInfo *userInfo, BOOL isSuc);
typedef void (^UserLoginData)(HRZUserInfo *userInfo, BOOL isSuc);
typedef void (^AttestationStoreData)(NSString *storeId, BOOL isSuc);
typedef void (^FileUploadData)(NSString *result, BOOL isSuc);

/** 我的 */
@interface HRZGlobalNetManager (User)

/**
 用户注册

 @param phone 电话
 @param phoneCode 验证码
 @param passWord 密码
 */
- (void)onUserRegisterByPhone:(NSString *)phone phoneCode:(NSString *)phoneCode passWord:(NSString *)passWord complete:(UserRegisterData)complete;


/**
 用户登录

 @param phone 账号：电话号
 @param passWord 密码
 @param phoneId 手机标示符（唯一）
 */
- (void)onUserLoginByPhone:(NSString *)phone passWord:(NSString *)passWord phoneIdentity:(NSString *)phoneId complete:(UserLoginData)complete;
/** 门店认证 */
- (void)onUserShopAttestationWith:(HRZAttestationModel *)model complete:(AttestationStoreData)complete;
/** 门店添加地址 */
- (void)onUserShopAddressAddWith:(HRZAddressUpdateModel *)model complete:(OperationResult)complete;
/** 搜索门店 */
- (void)onSearchShopAddressByShopId:(NSString *)shopId complete:(OperationResult)complete;
/** 上传图片 */
- (void)onUserShopUploadImage:(UIImage *)image complete:(FileUploadData)complete;;

@end

#pragma mark - ----------  Order  ----------

@class HRZIssuedOrderModel;
@class HRZOrderPayModel;
@class HRZOrderModel;
@class HRZCartGoodsDetailModel;

typedef void (^CreateOrderData)(NSString *result, BOOL isSuc);
typedef void (^CreateOrderType)(NSString *result, BOOL isSuc);
typedef void (^SearchOrderSatus)(NSArray <HRZOrderModel *>*result, BOOL isSuc);
typedef void (^SearchOrderDetail)(HRZOrderModel *result, BOOL isSuc);

typedef NS_ENUM(NSInteger, HRZOrderStatus) {
    HRZOrderStatusUnPay,
    HRZOrderStatusUnSend,
    HRZOrderStatusSend,
    HRZOrderStatusUnComment,
    HRZOrderStatusComment,
};


typedef NS_ENUM(NSInteger, HRZOrderPayType) {
    HRZOrderPayTypeOnline,
    HRZOrderPayTypeUnderLine,
};

/** 订单 */
@interface HRZGlobalNetManager (Order)

/** 创建订单 */
- (void)onCreateOrderWithCartGoods:(NSArray <HRZCartGoodsDetailModel *>*)array complete:(CreateOrderData)complete;

/** 订单支付 */
- (void)onCreateOrderPayWithOrderId:(NSString *)orderId payType:(HRZOrderPayType)payType complete:(CreateOrderType)complete;

/** 根据订单状态搜索订单 */
- (void)onSearchOrderByOrderStatus:(HRZOrderStatus)status complete:(SearchOrderSatus)complete;

/** 获取订单详情 */
- (void)onSearchOrderDetailByOrderId:(NSString *)orderId complete:(SearchOrderDetail)complete;

@end



